import { createRouter, createWebHashHistory } from 'vue-router'

const routerHistory = createWebHashHistory()
const router = createRouter({
  history: routerHistory,
  routes: [
    {
      path: '/:pathMatch(.*)',
      name: '404',
      component: () => import('@/views/errors/pages/404.vue'),
      meta: {
        keepAlive: false,
        title: '404'
      }
    },
    {
      path: '/',
      redirect: '/home',
      meta: { title: '首页' },
      children: [
        {
          path: '/home',
          name: 'Home',
          component: () => import('@/views/home/pages/index.vue'),
          meta: {
            keepAlive: false,
            title: '首页'
          }
        }
      ]
    },
    {
      path: '/study_0',
      name: 'Study_0',
      component: () => import('@/views/study/study_0/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '学习-0：其他测试'
      }
    },
    {
      path: '/study_1',
      name: 'Study_1',
      component: () => import('@/views/study/study_1/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '学习-1：操作dom'
      }
    },
    {
      path: '/study_2',
      name: 'Study_2',
      component: () => import('@/views/study/study_2/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '学习-2：操作交互'
      }
    },
    {
      path: '/study_3',
      name: 'Study_3',
      component: () => import('@/views/study/study_3/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '学习-3：力导向图'
      }
    },
    {
      path: '/study_4',
      name: 'Study_4',
      component: () => import('@/views/study/study_4/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '学习-4：动画'
      }
    },
    {
      path: '/bar',
      name: 'Bar',
      component: () => import('@/views/chart/bar/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '练习-1：柱状图'
      }
    },
    {
      path: '/knowledgeGraph',
      name: 'KnowledgeGraph',
      component: () => import('@/views/knowledgeGraph/pages/index.vue'),
      meta: {
        keepAlive: false,
        title: '案例：知识图谱'
      }
    }

  ]
})

export default router
